<%= link_to(image_tag("new.png", :size => "16x16"), new_service_container_path) %>
<h1><%= @service_containers.length%> service_containers</h1>

<table>
  <tr>
    <th><%= image_tag("digg_48.png", :size => "20x20") %><br/>Name</th>
<!--    <th><%= image_tag("image_48.png", :size => "20x20") %><br/>Description</th> -->
	<th><%= image_tag("clock_48.png", :size => "20x20") %><br/>Freq</th>
	<th><%= image_tag("phone.png", :size => "20x20") %><br/>Service Template</th>
<!--	<th><%= image_tag("computer_48.png", :size => "20x20") %><br/>Check Command</th><th>|</th> -->
<!--	<th><%= image_tag("heart_48.png", :size => "20x20") %><br/>Autofix</th> -->
	<th><%= image_tag("accepted_48.png", :size => "20x20") %><br/>Service Checks</th> 
  </tr>

<% for service_container in @service_containers.sort{|a,b| a.name.downcase <=> b.name.downcase} %>
  <tr class=<%= cycle('row_odd','row_even')%> >
    <td>
      <%= link_to(image_tag("trashcan.png", :size => "20x20"), service_container, :confirm => 'Are you sure you want to delete Service container: ' + service_container.name + '?', :method => :delete) %>

      <%= link_to service_container.name, edit_service_container_path(service_container) %>
    </td>
<!--	
    <td>
    	<%=h truncate(service_container.description.capitalize,60) %>
	</td>
-->	
    <td>
        <%= service_container.frequency %> <br/>
    </td>
    <td>
		<%= service_container.nagios_service_template.name rescue nil %>
    </td>
	  <td>
      <% for service in service_container.service_checks.sort{|a,b| a.name <=> b.name}%>          
        <%= link_to service.name, edit_service_check_path(service) %>
                <% if service.parent_id == 2 %>
                  <%= image_tag("parents-48x48.png", :size => "16x16") %>
                <% end %>
                <br/>
      <% end %>

    </td>	
  </tr>
<% end %>
</table>

<h1><%= @service_containers.length%> service_containers</h1>
<%= link_to(image_tag("new.png", :size => "16x16"), new_service_container_path) %>
<br />
